package away3d.animators
{
	import away3d.animators.nodes.*;
	import away3d.animators.states.*;
	import away3d.cameras.Camera3D;
	import away3d.core.base.*;
	import away3d.core.managers.*;
	import away3d.entities.*;
	import away3d.materials.passes.*;
	
	/**
	 * 动画控制器类接口, 用于控制一个<code>AnimationSetBase</code>的数据集子类的动画输出.
	 * Provides an interface for animator classes that control animation output from a data set subtype of <code>AnimationSetBase</code>.
	 * @see away3d.animators.IAnimationSet
	 */
	public interface IAnimator
	{
		/**
		 * 返回控制器正在使用中的动画数据集
		 * Returns the animation data set in use by the animator.
		 */
		function get animationSet() : IAnimationSet;
		
		/**
		 * 依据被渲染的对象设置动画需求的GPU渲染状态。
		 * Sets the GPU render state required by the animation that is dependent of the rendered object.
		 *
		 * @param stage3DProxy 当前正在被用于渲染的Stage3DProxy对象. The Stage3DProxy object which is currently being used for rendering.
		 * @param renderable 当前正在被渲染的对象. The object currently being rendered.
		 * @param vertexConstantOffset 如果运行于GPU, 首个可用于写入数据的顶点寄存器. The first available vertex register to write data to if running on the gpu.
		 * @param vertexStreamOffset 如果运行于GPU, 首个可用于写入数据的流处理器. The first available vertex stream to write vertex data to if running on the gpu.
		 */
		function setRenderState(stage3DProxy : Stage3DProxy, renderable : IRenderable, vertexConstantOffset : int, vertexStreamOffset : int, camera:Camera3D) : void
		
        /**
		 * 检测动画是否会被用于CPU上. 材质类型的Pass对象(<code>pass</code>参数)构造参数需要设为true以便用于GPU. 如果代码会潜在运行于GPU上时, 需要调用该函数检测.
         * Verifies if the animation will be used on cpu. Needs to be true for all passes for a material to be able to use it on gpu.
		 * Needs to be called if gpu code is potentially required.
         */
		function testGPUCompatibility(pass : MaterialPassBase) : void;
		
		/**
		 * 用于注册一个Mesh对象为动画控制器的所有者, 以便内部使用.
		 * Used by the mesh object to which the animator is applied, registers the owner for internal use.
		 *
		 * @private
		 */
		function addOwner(mesh : Mesh) : void
		
		/**
		 * 用于从动画控制器删除已注册的Mesh对象.
		 * Used by the mesh object from which the animator is removed, unregisters the owner for internal use.
		 *
		 * @private
		 */
		function removeOwner(mesh : Mesh) : void
		
		/**
		 * 取得指定动画节点的动画状态
		 */
		function getAnimationState(node:AnimationNodeBase):AnimationStateBase;
		
		/**
		 * 通过动画状态名取得动画状态
		 */
		function getAnimationStateByName(name:String):AnimationStateBase;
	}
}